%CREATEPARAMETERSFILE Weater data set parameters file creator.
%
%   elstonj 06-06-14
function CreateParametersFile(simdata,directory)
%*=+--+=#=+--      UAS Severe Weather Simulation Softeware        --+=#=+--+=#*%
%          Copyright (C) 2014 Regents of the University of Colorado.           %
%                             All Rights Reserved.                             %
%                                                                              %
%    This program is free software: you can redistribute it and/or modify      %
%    it under the terms of the GNU General Public License version 2 as         %
%    published by the Free Software Foundation.                                %
%                                                                              %
%    This program is distributed in the hope that it will be useful,           %
%    but WITHOUT ANY WARRANTY; without even the implied warranty of            %
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             %
%    GNU General Public License for more details.                              %
%                                                                              %
%    You should have received a copy of the GNU General Public License         %
%    along with this program.  If not, see <http://www.gnu.org/licenses/>.     %
%                                                                              %
%           Jack Elston                                                        %
%           elstonj@colorado.edu                                               %
%                                                                              %
%*=+--+=#=+--                 --+=#=+--+=#=+--                    --+=#=+--+=#*%

filename = strcat(directory,'parameters.m');
if exist(directory) ~= 7
	mkdir(directory);
end
fid = fopen(filename, 'w');

copyright='%%*=+--+=#=+--      UAS Severe Weather Simulation Softeware        --+=#=+--+=#*%%\n%%          Copyright (C) 2014 Regents of the University of Colorado.           %%\n%%                             All Rights Reserved.                             %%\n%%                                                                              %%\n%%    This program is free software: you can redistribute it and/or modify      %%\n%%    it under the terms of the GNU General Public License version 2 as         %%\n%%    published by the Free Software Foundation.                                %%\n%%                                                                              %%\n%%    This program is distributed in the hope that it will be useful,           %%\n%%    but WITHOUT ANY WARRANTY; without even the implied warranty of            %%\n%%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             %%\n%%    GNU General Public License for more details.                              %%\n%%                                                                              %%\n%%    You should have received a copy of the GNU General Public License         %%\n%%    along with this program.  If not, see <http://www.gnu.org/licenses/>.     %%\n%%                                                                              %%\n%%           Jack Elston                                                        %%\n%%           elstonj@colorado.edu                                               %%\n%%                                                                              %%\n%%*=+--+=#=+--                 --+=#=+--+=#=+--                    --+=#=+--+=#*%%\n';

fprintf(fid,copyright);

fprintf(fid,'simdata.prefix      = ''%s''\n',simdata.prefix);
fprintf(fid,'\n');
fprintf(fid,'  %%---- [ Time ] ------------------------------------------------------------%%\n');
fprintf(fid,'simdata.t0          = %d;\n',simdata.t0);
fprintf(fid,'simdata.ts          = %d;\n',simdata.ts);
fprintf(fid,'simdata.tf          = %d;\n',simdata.tf);
fprintf(fid,'\n');
fprintf(fid,'  %%----- [ X Parameters ] ---------------------------------------------------%%\n');
fprintf(fid,'simdata.xnum        = %i;     %% number of data points\n',simdata.xnum);
fprintf(fid,'simdata.x0          = %d;      %% m\n',simdata.x0);
fprintf(fid,'simdata.xs          = %d;      %% m\n',simdata.xs);
fprintf(fid,'\n');
fprintf(fid,'  %%----- [ Y Parameters ] --------------------------------------------------%%\n');
fprintf(fid,'simdata.ynum        = %i;     %% number of data points\n',simdata.ynum);
fprintf(fid,'simdata.y0          = %d;      %% m\n',simdata.y0);
fprintf(fid,'simdata.ys          = %d;      %% m\n',simdata.ys);
fprintf(fid,'\n');
fprintf(fid,'  %%----- [ Z Parameters ] --------------------------------------------------%%\n');
fprintf(fid,'simdata.znum        = %i;      %% number of data points\n',simdata.znum);
fprintf(fid,'simdata.z0          = %d;    %% m AGL\n',simdata.z0);
fprintf(fid,'simdata.zs          = %d;      %% m\n',simdata.zs);
fprintf(fid,'\n');
fprintf(fid,'  %%----- [ Reference Frame ] -----------------------------------------------%%\n');
fprintf(fid,'simdata.frame.u     = %d;       %% m/s\n',simdata.frame.u);
fprintf(fid,'simdata.frame.v     = %d;     %% m/s\n',simdata.frame.v);

fclose(fid);
